<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" href="../css/style.css" rel="stylesheet"/>
<link type="text/css" href="../css/admin.css" rel="stylesheet"/>
<script type="text/javascript" src="../js/jquery.js"></script>
<script src="../js/interface.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
	$("#search").val('搜索，就是这么简单').css('color','#6d6d6d');
	$("#search").focusin(function(){
		if($('#search').val() =='搜索，就是这么简单'){
			$('#search').val('').css('color','#000');
		}
	}).focusout(function(){
		if($('#search').val() ==''){
			$('#search').val('搜索，就是这么简单').css('color','#6d6d6d');
		}
	
	});
	
	$(".blog a").hover(function(){
		$(this).stop().animate({marginLeft:"8px"},400);
	},function(){
		$(this).stop().animate({marginLeft:"0px"},400);
	});	
		
	$(".navmain tr:odd").addClass("alt");//给class为stripe的表格的偶数添加class值为alt
});
</script>
<title>首页</title>
</head>

<body>
<a rel="nofollow" href="feedback.php" class="w-fank">意见反馈</a>
<div id="main">
<?php require 'header.php';?>
	<div class="navmain">
		<img src="../images/content_top_wide.png" alt="" />
		<div class="nav">
			<div class="navtop1">
			<span class="blog"> <a href="links.php?a=0">未审核博客</a></span>
			<span class="blog"> <a href="links.php?r=1">已推荐博客</a></span>
			<?php
				$sql = mysql_query("select * from classify");
				while($row = mysql_fetch_array($sql)){
			?>
				<span class="blog"> <a href="links.php?classname=<?php echo $row['classname'] ?>"><?php echo $row['classname'] ?></a></span>
			<?php };?>
			</div>
		</div>
		<img src="../images/content_bottom_wide.png" alt="" />
	</div><br />

	<div class="navmain">
		<img src="../images/content_top_wide.png" />
		<table width="100%">
			<tr style="color:orange">
				<td>ID</td>
				<td>博客名称</td>
				<td>博客类型</td>
				<td>邮箱</td>
				<td>访问量</td>
				<td>推荐</td>
				<td>报错</td>
				<td>审核</td>
				<td>申请时间</td>
				<td>操作<td>
			</tr>	
			<?php
				$sql = mysql_query("select * from links where classname='$_GET[classname]' order by id desc");
				if($_GET[searchbox] !=""){
					$sql = mysql_query("select * from links where concat(id,name,link) like '%$_GET[searchbox]%' order by id desc");
				}
				if($_GET[a] !=""){
					$sql = mysql_query("select * from links where audit=0 order by id desc");
				}
				if($_GET[r] !=""){
					$sql = mysql_query("select * from links where recommend=1 order by id desc");
				}				
				while($row = mysql_fetch_array($sql)){	
			?>
			<tr>
				<td><?php echo $row['id'];?></td>
				<td><a href="../showurl.php?id=<?php echo $row['id'];?>" title="<?php echo $row['info'];?>" target="_blank"><?php echo $row['name'];?></a></td>
				<td><?php echo $row['classname'];?></td>
				<td><?php echo $row['email'];?></td>
				<td><?php echo $row['visit'];?> 次</td>
				<td>
				<?php
					switch ($row['recommend']) {
						case 0:
						echo '<a id="red" href="state_ini.php?id='.$row[id].'&&r='.$row[recommend].'" title="状态:没有被推荐">推荐</a>';//
						break;
						case 1:
						echo '<a id="green" href="state_ini.php?id='.$row[id].' &&  r='.$row[recommend].'" title="状态:已推荐">取消推荐</a>';//成功
						break;	
					}
				?>
				</td>
				<td><?php echo $row['error'];?> 次</td>
				<td>
				<?php
					switch ($row['audit']) {
						case 0:
						echo '<a id="red" href="state_ini.php?id='.$row[id].' &&  a='.$row[audit].'" title="状态:没有被审核">审核</a>';//
						break;
						case 1:
						echo '<a id="green" href="state_ini.php?id='.$row[id].' &&  a='.$row[audit].'" title="状态:已审核">取消审核</a>';//成功
						break;	
					}
				?>
				</td>
				<td><?php echo $row['time'];?></td>
				<td><a href="change_links.php?id=<?php echo $row[id];?>">修改</a> | <a href="del_ini.php?id=<?php echo $row[id];?>">删除</a></td>
			</tr>
			<?php };?>
		</table>
		<img src="../images/content_bottom_wide.png" />
	</div><br />
<?php require 'footer.php';?>
</div>
</body>
</html>
